package com.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.beans.Cla;
import com.service.IClaService;

/**
 *  Class Name: ClaController.java
 *  Description: 班级接收数据层
 *  @author Sirius  DateTime 2019年7月24日 上午9:44:25 
 *  @company private
 *  @email 
 *  @version 1.0
 *  
 */
@Controller
public class ClaController {

	// 注入service
	@Autowired
	private IClaService claService;
	
	// 注册
	@RequestMapping("/claRegister.action")
	public String register(Cla cla){
		claService.register(cla);
		return "redirect:getStuListByPage.action?pageindex=1";
	}
	
	//获取班级数据
	@RequestMapping("/getAllCla.action")
	public ModelAndView getAllCla(){
		List<Cla> list = claService.getAllList();
		ModelAndView mv = new ModelAndView();
		mv.addObject("clist", list);
		mv.setViewName("studentRegister");
		return mv;
	}
}
